/**
 * Copyright (C) 2017 - 2020 https://github.com/joewee
 * <p>
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * <p>
 * http://www.apache.org/licenses/LICENSE-2.0
 * <p>
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.bifrost.workflow.inventory.extension;

import com.bifrost.entity.Product;
import com.bifrost.entity.ProductSku;
import com.bifrost.exception.InventoryUnavailableException;
import com.bifrost.extension.AbstractExtensionHandler;
import com.bifrost.extension.ExtensionResultHolder;
import com.bifrost.extension.ExtensionResultStatusType;

import java.util.Collection;
import java.util.Map;

/**
 * @author joewee
 * @version 1.0.0
 * @Date 2017/11/17 20:28
 */
public abstract class AbstractInventoryServiceExtensionHandler extends AbstractExtensionHandler implements InventoryServiceExtensionHandler {

    @Override
    public ExtensionResultStatusType retrieveQuantitiesAvailable(Collection<ProductSku> skus, Map<String, Object> context, ExtensionResultHolder<Map<ProductSku, Integer>> result) {
        return ExtensionResultStatusType.NOT_HANDLED;
    }

    @Override
    public ExtensionResultStatusType decrementInventory(Map<ProductSku, Integer> skuQuantities, Map<String, Object> context) throws InventoryUnavailableException {
        return ExtensionResultStatusType.NOT_HANDLED;
    }

    @Override
    public ExtensionResultStatusType incrementInventory(Map<ProductSku, Integer> skuQuantities, Map<String, Object> context) {
        return ExtensionResultStatusType.NOT_HANDLED;
    }

    @Override
    public ExtensionResultStatusType reconcileChangeOrderInventory(Map<ProductSku, Integer> decrementSkuQuantities, Map<ProductSku, Integer> incrementSkuQuantities, Map<String, Object> context) throws InventoryUnavailableException {
        return ExtensionResultStatusType.NOT_HANDLED;
    }

    @Override
    public ExtensionResultStatusType isProductBundleAvailable(Product product, int quantity, ExtensionResultHolder<Boolean> holder) {
        return ExtensionResultStatusType.NOT_HANDLED;
    }
}
